main(n,i){for(gets(&n);~scanf("%d",&n);printf("%d\n",n/i))for(i=10000;i>100;printf("%d ",n/i),n-=i*(int)(n/i),i=(int)(i/pow(10,(int)log10(i)))&4?i/5:i/2);}
